attempt to deal with rounding issue when creating the swap chain #997
+83
−61
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
While resizing a window on a high DPI display, some window sizes cause an off by one error when recalculating the physical size of the window. This causes the swap chain to fail to resize until the window resized again to a "good" resolution. The issue is caused by the logical size being stored as an integer which looses precision when calculated from the physical size.
This patch attempts to solve the issue by storing the physical resolution of the window instead of the logical resolution. As part of the effort,
width
&height
becomelogical_width
&logical_height
,scaled_width
&scaled_height
becomephysical_width
&physical_height
. This requires touching a number of things and will probably break downstream users. It also changes the type of the components of the logical size tof32
so it can better represent sizes that are a fraction of a pixel.